package com.etc.user.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;


import com.etc.entity.User;
import com.etc.user.dao.UsersMapper;
import com.etc.user.service.UsersService;
@Service(value="usersService")
public class UsersServiceImpl implements UsersService {
	@Resource(name="usersMapper")
	private UsersMapper usersMapper;
	/**
	 * 陈楠 前台登录
	 */

	@Override
	public User login(String username, String password) {
		// TODO Auto-generated method stub
		return usersMapper.findWithLoginAndPassword(username, password);
	}
	
	
	
	@Override
	public boolean insertSelective(User user) {
		// TODO Auto-generated method stub
		return usersMapper.insertSelective(user)>0;
	}



	@Override
	public boolean selectUserByUserName(String username) {
		// TODO Auto-generated method stub
		if (usersMapper.selectUserByUserName(username)==null) {
			return true;
		}else {
			return false;
		}
			
	}

}
